import request from "@/utils/request";

// 回顾知识点： 什么是 RESTful 接口规范

// 5个标准格式组成：
// 新增   post   body【data】   /api/news/book
// 修改   put    body【data】   /api/news/book/修改的ID
// 删除   delete body【data】   /api/news/book/删除的ID
// 查询   get
// 查询列表      query【params】 /api/news/book/
// 查询单个                      /api/news/book/查询ID

// 查询列表
export const getDepartmentListApi = (params) => {
  return request({
    url: "/company/department",
    method: "get",
    params,
  });
};
// 查询单个
export const getDepartmentInfoApi = (id) => {
  return request({
    url: "/company/department/" + id,
    method: "get",
  });
};
// 添加
export const addDepartmentApi = (data) => {
  return request({
    url: "/company/department",
    method: "post",
    data,
  });
};
// 修改
export const editDepartmentApi = (data) => {
  return request({
    url: "/company/department/" + data.id,
    method: "put",
    data,
  });
};
// 删除
export const delDepartmentApi = (id) => {
  return request({
    url: "/company/department/" + id,
    method: "delete",
  });
};
